<template>
  <div>
    <el-card>
      <el-form :inline="true" class="flex">
        <el-form-item label="一级分类">
          <el-select
            v-model="CategoryStore.C1Id"
            @change="handler"
            style="width: 240px"
          >
            <el-option
              v-for="c1 in CategoryStore.C1Arr"
              :key="c1.id"
              :label="c1.name"
              :value="c1.id"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="二级分类">
          <el-select
            v-model="CategoryStore.C2Id"
            @change="handler1"
            style="width: 240px"
          >
            <el-option
              v-for="c2 in CategoryStore.C2Arr"
              :key="c2.id"
              :label="c2.name"
              :value="c2.id"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="三级分类">
          <el-select
            v-model="CategoryStore.C3Id"
            @change="handler2"
            style="width: 240px"
          >
            <el-option
              v-for="c3 in CategoryStore.C3Arr"
              :key="c3.id"
              :label="c3.name"
              :value="c3.id"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script setup lang="ts">
import useCategoryStore from '../../store/modules/category/category'
let CategoryStore = useCategoryStore()
const handler = () => {
  CategoryStore.getC2()
}
const handler1 = () => {
  CategoryStore.getC3()
}
const handler2 = () => {
  console.log(333)
}
</script>

<style scoped></style>
